package models

import (
	"github.com/astaxie/beego/orm"
)

// 定义 type
type HomeMenu struct {
    Id       int
    MenuNumber string
    Name    string
	Url string
}

// 注册models
//func init() {
//	orm.RegisterModel(new(HomeMenu))
//}

// 获取菜单列表
func GetMenu() ([]HomeMenu,error) {
	o := orm.NewOrm()
	var buffer []HomeMenu
	_, err := o.Raw("SELECT * FROM `home_menu`").QueryRows(&buffer)
	return buffer,err
}